import json

if __name__ == '__main__':
    #json  '{"name":"北冰洋","price":6,"type":"橙子味"}'
    dict = {"name":"北冰洋","price":6,"type":"橙子味"}
    #字典和json的转换
    #字符串没有k与y
    strDict=json.dumps(dict)
    print(strDict)
    print(type(strDict))
    #print(dict1["name"])
#转为字典
    dict1=json.loads(strDict)
    print(type(dict1))
    print(dict1["name"])